package com.zeroext.sys.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    private static final DateFormat FORMATER_YYMMDDHHMMSS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    
    private static final DateFormat FORMATER_YYMMDD = new SimpleDateFormat("yyyy-MM-dd");
    
    private static final DateFormat FORMATER_HHMMSS = new  SimpleDateFormat("HH:mm:ss");
    
    
    public static String getYYMMDD(Date date){
        return getFormatedTime(date,FORMATER_YYMMDD);
    }
    
    public static String getHHMMSS(Date date){
        return getFormatedTime(date,FORMATER_HHMMSS);
    }
    
    
    public static String getYYMMDDHHMMSS(Date date){
        return getFormatedTime(date,FORMATER_YYMMDDHHMMSS);
    }
    
    public final static String getFormatedTime(Date date,DateFormat formater){
        return date==null?"":formater.format(date);
    }
     
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

    }

}
